﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

<div class="modal-dialog demo2do-modal-dialog" style="width: 1000px">

  <div class="modal-content">

    <div class="modal-header beast-breadcrumb no-bottom-border clearfix">

      <h2><i class="glyphicon glyphicon-fire" title=""></i>&nbsp;&nbsp;<span>用户列表&nbsp;-&nbsp;过滤查询</span></h2>

      <button type="button" class="close" data-dismiss="modal">&times;</button>

    </div>

    <form class="form-horizontal" method="GET" action="${ctx.host}/${param.module == 'audit' ? 'customer-audits':'customers'}/search">

      <input type="hidden" name="filter" value="true" >

      <div class="modal-body">

        <div class="form-group demo2do-form-group">
          
          <label class="col-xs-2 control-label">联系人</label>
          <div class="pull-left" style="width: 30%">
            <input type="text" class="form-control" name="nickName" />
          </div>
          
          <label class="col-xs-2 control-label">手机号码</label>
          <div class="pull-left" style="width: 30%">
            <input type="text" class="form-control" name="mobile" />
          </div>
          
        </div>
        
        <div class="form-group demo2do-form-group">
          <label class="col-xs-2 control-label">来源</label>
          <div class="pull-left" style="width: 30%">
            <select name="source" class="form-control" data-live-search="true" data-size="5">
                <option value="">全部</option>
                <c:forEach var="source" items="${enums['customerSource']}" >
                    <option value="${source.name}">${source.description}</option>
                </c:forEach>
            </select>
          </div>

          <label class="col-xs-2 control-label">审核状态</label>
          <div class="pull-left" style="width: 30%">
            <c:if test="${param.module != 'audit' }">
                <select name="auditStatus" class="form-control">
                  <option value="">全部</option>
                  <c:forEach var="auditStatus" items="${enums['auditStatus']}" >
                    <option value="${auditStatus.name}">${auditStatus.description}</option>
                  </c:forEach>
                </select>
            </c:if>
            <c:if test="${param.module == 'audit'}">
                <p class="form-control-static">审核中</p>
            </c:if>
          </div>

        </div>

        <div class="form-group demo2do-form-group">
          <label class="col-xs-2 control-label">注册时间</label>
          <div class="pull-left" style="width: 30%">

            <div class="input-group">
                <input type="text" class="form-control date" name="createTimeBegin" />
                <span class="input-group-addon">~</span>
                <input type="text" class="form-control date" name="createTimeEnd" />
            </div>
          </div>
        </div>
        
      </div>

      <div class="modal-footer">
        <button type="submit" class="btn btn-success btn-shadow btn-shadow-success demo2do-btn">查询</button>&nbsp;&nbsp;&nbsp;&nbsp;
        <button type="button" class="btn btn-default btn-shadow btn-shadow-default demo2do-btn" data-dismiss="modal">取消</button>
      </div>

    </form>

  </div>
  
  <script type="text/javascript">
    
    $(document).ready(function(){

        $('.date').datetimepicker({
          format: 'yyyy-mm-dd',
          autoclose: true,
          language: 'zh-CN',
          todayBtn: 'linked',
          todayHighlight: true,
          pickerPosition: 'bottom-right',
          minView: 'month'
        })

        $('select[name="source"]').select2({
            placeholder: '选择来源',
            minimumResultsForSearch: -1,
            allowClear: true
        });
        
        $('select[name="auditStatus"]').select2({
            placeholder: '选择状态',
            minimumResultsForSearch: -1,
            allowClear: true
        });
       
    })
    
  </script>

</div>